﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using UCenter.Core.Model;

namespace UCenter.Models
{
    [Table(Name = "Message")]
    public class Message : EntityBase
    {
        #region Private Fields

        private int _Id;

        private int _toUserID;

        private int _fromUserID;

        private DateTime _sendDate;

        private string _subject;

        private string _content;

        private byte _type;

        private bool _isNew;

        private bool _idDeleted;

        #endregion
        [Column(Name = "ID", IsPrimaryKey = true, IsDbGenerated = true)]
        public int ID {
            get {
                return this._Id;
            }
            set {
                if ((this._Id != value)) {
                    this.SendPropertyChanging("ID");
                    this._Id = value;
                    this.SendPropertyChanged("ID", value);
                }
            }
        }

        [Column(Name = "ToUserID")]
        public int ToUserID {
            get {
                return this._toUserID;
            }
            set {
                if ((this._toUserID != value)) {
                    this.SendPropertyChanging("ToUserID");
                    this._toUserID = value;
                    this.SendPropertyChanged("ToUserID", value);
                }
            }
        }

        [Column(Name = "FromUserID")]
        public int FromUserID {
            get {
                return this._fromUserID;
            }
            set {
                if ((this._fromUserID != value)) {
                    this.SendPropertyChanging("FromUserID");
                    this._fromUserID = value;
                    this.SendPropertyChanged("FromUserID", value);
                }
            }
        }

        [Column(Name = "SentDate")]
        public DateTime SentDate
        {
            get {
                return this._sendDate;
            }
            set {
                if ((this._sendDate != value)) {
                    this.SendPropertyChanging("SentDate");
                    this._sendDate = value;
                    this.SendPropertyChanged("SentDate", value);
                }
            }
        }

        [Column(Name = "Message")]
        public String Content {
            get {
                return this._content;
            }
            set {
                if ((this._content != value)) {
                    this.SendPropertyChanging("Content");
                    this._content = value;
                    this.SendPropertyChanged("Content", value);
                }
            }
        }

        [Column(Name = "Subject")]
        public String Subject
        {
            get
            {
                return this._subject;
            }
            set
            {
                if ((this._content != value))
                {
                    this.SendPropertyChanging("Subject");
                    this._subject = value;
                    this.SendPropertyChanged("Subject", value);
                }
            }
        }

        [Column(Name = "IsDeleted")]
        public bool IsDeleted {
            get {
                return this._idDeleted;
            }
            set {
                if ((this._idDeleted != value)) {
                    this.SendPropertyChanging("IsDeleted");
                    this._idDeleted = value;
                    this.SendPropertyChanged("IsDeleted", value);
                }
            }
        }

        [Column(Name = "Type")]
        public byte Type {
            get {
                return this._type;
            }
            set {
                if ((this._type != value)) {
                    this.SendPropertyChanging("Type");
                    this._type = value;
                    this.SendPropertyChanged("Type", value);
                }
            }
        }

        [Column(Name = "IsNew")]
        public bool IsNew {
            get {
                return this._isNew;
            }
            set {
                if ((this._isNew != value)) {
                    this.SendPropertyChanging("IsNew");
                    this._isNew = value;
                    this.SendPropertyChanged("IsNew", value);
                }
            }
        }
    }
}
